﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using SmartWarehouse.Common;
using SmartWarehouse.ORM.Entity;
using SmartWarehouse.BussinessLogic.Basis;

public partial class ProductMaintenance :SwBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        SwProduct product = new SwProduct();
        product.Name = this.txtName.Text;
        product.Desc = this.txtDesc.Text;
        product.Uom = this.txtUom.Text;
        product.Price = decimal.Parse(this.txtPrice.Text);
        product.Supplier = txtSupplier.Text;
        product.Origin = txtOrigin.Text;

        ProductFacade productFacade = new ProductFacade();
        SwMessage  message =  productFacade.AddProduct(product);
        this.ShowMessage(message);
    }


    protected void btnCancel_Click(object sender, EventArgs e)
    {
        this.txtName.Text = "";
        this.txtUom.Text = "";
        this.txtPrice.Text = "";
        this.txtSupplier.Text = "";
        this.txtOrigin.Text = "";
        this.txtDesc.Text = "";
    }
}
